package com.example.mapper;

import com.example.entity.Member;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface MemberMapper {

    @Insert("insert into member (username, password,himg,integration,name, phone, email) values (#{username}, #{password},#{himg},#{integration}, #{name}, #{phone}, #{email})")
    void insert(Member member);

    List<Member> selectAll(Member member);

    @Update("update member set username = #{username}, password = #{password}, himg = #{himg},integration = #{integration},name = #{name}, phone = #{phone}, email = #{email} where id = #{id}")
    void updateById(Member member);

    @Delete("delete from member where id = #{id}")
    void deleteById(Integer id);

    @Select("select * from member where username = #{username} and password = #{password}")
    Member selectByUsernameAndPassword(Member member);
}
